<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <a href="http://www.apple.com" @click="handleClick('禁止打开',$event)">打开链接  </a>
        <!-- 点击次数: {{counter}} -->
        <!-- <button @click="counter++">+ 1</button> -->
        <!-- <button @click="handleAdd">+ 1</button>
        <button @click="handleAdd(10)">+ 10</button> -->
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                counter: 0
            },
            methods:{
                handleAdd:function(count){
                    count = count || 1;
                    this.counter +=count;
                    console.log(count);
                },
                handleClick:function(message,event){
                    event.preventDefault();
                    window.alert(message);
                }
            }
        })
    </script>
</body>

</html>